<?php
namespace Models\Model;
use Zend\Db\ResultSet\ResultSet;
use Zend\Db\TableGateway\TableGateway;
use Zend\Db\Sql;
use Zend\Db\Sql\Where;
use Zend\Db\Sql\Select;
use Zend\Paginator\Adapter\DbSelect;
use Zend\Paginator\Paginator;
use Zend\Db\Sql\Predicate;
use Zend\Db\Sql\Expression;
class WinnerdetailsTable
{
    protected $tableGateway;
	protected $select;
    public function __construct(TableGateway $tableGateway)
    {
        $this->tableGateway = $tableGateway;
		$this->select = new Select();
    }
	//Registration
	public function saveContactDetailes($register){
		$data = array(
			'user_id' 				=> $register['imeiNumber'], 			
			'user_name'  	 		=> $register['name'],  	
			'user_email' 	 		=> $register['email'],  
			'user_contact_num'	 	=> $register['phone'], 							
		);	
		$insertresult=$this->tableGateway->insert($data);	
		return $this->tableGateway->lastInsertValue;
    }	
	
	public function checkingImeiNumber($imei_number){	
		$select = $this->tableGateway->getSql()->select();
		$select->where('imei_number="'.$imei_number.'"');	
		$resultSet = $this->tableGateway->selectWith($select);
		return $resultSet;
	}
}